A client-server architecture, in general, is a distributed computing architecture that partitions tasks or work loads between servers, which may be considered as “service providers”, and clients, which may be considered as “service requesters” or “service consumers”. Often, the servers and the clients are connected via a computer network and various types of data may be transmitted between individual servers and individual clients bi-directionally over the computer network.
The servers usually have more resources and greater performance capabilities than the clients. A server may share its resources with one or more clients, such as performing certain tasks for the clients (i.e., providing services to the clients). Because a server typically has more resources than a client, the server may complete a task, especially a resource-demanding task, much faster than the client is able to.
Data exchanged between a server and a client may be represented using any suitable data format and transmitted using any suitable communications protocol. For example, when an application is executed on a server for a client, the output of the application may be represented using a structured document, such as a HyperText Markup Language (HTML) document or an Extensible Markup Language (XML) document. The server may transmit the HTML or XML document, which includes the data that represent the output of the application, to the client over a HyperText Transfer Protocol (HTTP) connection between the server and the client. The client, upon receiving the HTML or XML document, may consume the document and render the output of the application locally using the HTML or XML document, such as in a web browser executed on the client.
Motion JPEG (M-JPEG) is a video format where each video frame or interlaced field of a digital video sequence is separately compressed as a JPEG image. In other words, M-JPEG employs stateless compression as information from a previously rendered frame is not used to compress the frames that follow. M-JPEG is however characterized by low-latency. When a client device receives a frame of compressed motion JPEG video, it can immediately decompress the frame and display it, resulting in very low latency. Originally developed for multimedia PC applications, where more advanced formats have displaced it, M-JPEG is now used by many portable devices with video-capture capability, such as digital cameras. Motion JPEG uses a lossy form of intraframe compression based on the discrete cosine transform (DCT). This mathematical operation converts each frame/field of the video source from the time domain into the frequency domain. A perceptual model based loosely on the human psycho-visual system discards high-frequency information, i.e. sharp transitions in intensity, and color hue. In the transform domain, the process of reducing information is called quantization. Quantization is a method for optimally reducing a large number scale (with different occurrences of each number) into a smaller one, and the transform-domain is a convenient representation of the image because the high-frequency coefficients, which contribute less to the over picture than other coefficients, are characteristically small-values with high compressibility. The quantized coefficients are then sequenced and losslessly packed into the output bit stream.
Mozilla and Webkit-based browsers have native support for viewing M-JPEG streams, other browsers can support M-JPEG streams using external plug-ins or applets. HTTP streaming separates each image into individual HTTP replies on a specified marker. RTP streaming creates packets of a sequence of JPEG images that can be received by clients such as QuickTime or VLC. The server software mentioned above streams the sequence of JPEGs over HTTP. A special mime-type content type multipart/x-mixed-replace;boundary=informs the browser to expect several parts as answer separated by a special boundary. This boundary is defined within the MIME-type. For M-JPEG streams the JPEG data is sent to the client with a correct HTTP-header. The TCP connection is not closed as long as the client wants to receive new frames and the server wants to provide new frames.